<?php

namespace App\Http\Presenters;

use Laracasts\Presenter\Presenter;


class BookPresenter extends Presenter
{
    /**
     * Present a link to the user gravatar
     */
    public function bookStatusPresenter()
    {
        switch ($this->status) {
            case 0:
                return '<span class="green b">未借</span>';
                break;
            case 1:
                return '<span class="red b">已借</span>';
                break;
        }
    }

    public function bookStatus()
    {
        switch ($this->status) {
            case 0:
                return '<i class="ace-icon fa fa-folder-o pink bigger-120"></i>';
                break;
            case 1:
                return '<i class="ace-icon fa fa-folder-open-o light-grey bigger-120"></i>';
                break;
        }
    }


    public function bookDamagePresenter()
    {
        switch ($this->damage) {
            case BOOK_DAMAGE_NEW:
                return '<span class="blue">新书</span>';
                break;
            case BOOK_DAMAGE_NODAMAGE:
                return '<span class="green">未破损</span>';
                break;
            case BOOK_DAMAGE_CANBORROW:
                return '<span class="orange2">可借阅</span>';
                break;
            case BOOK_DAMAGE_NOTBORROW:
                return '<span class="red">不可借</span>';
                break;
        }
    }

    public function bookDamage()
    {
        switch ($this->damage) {
            case BOOK_DAMAGE_NEW:
                return '<i class="ace-icon fa fa-tag blue bigger-120"></i>';
                break;
            case BOOK_DAMAGE_NODAMAGE:
                return '<i class="ace-icon fa fa-check-square-o green bigger-120"></i>';
                break;
            case BOOK_DAMAGE_CANBORROW:
                return '<i class="ace-icon fa fa-exclamation-circle orange bigger-120"></i>';
                break;
            case BOOK_DAMAGE_NOTBORROW:
                return '<i class="ace-icon fa fa-ban red bigger-120"></i>';
                break;
        }
    }

    public function bookCategoryName()
    {
        switch ($this->bookcategory) {
            case 1:
                return '<span class="red-block">图画绘本</span>';
                break;
            case 2:
                return '<span class="green-block">文学故事</span>';
                break;
            case 3:
                return '<span class="aqua-block">科普读物</span>';
                break;
            case 4:
                return '<span class="purple-block">亲子教育</span>';
                break;
        }
    }

    public function bookStore()
    {
        $store = $this->bookcase . '-' . $this->bookshelf;
        switch ($this->bookcategory) {
            case 1:
                return '<span class="store-block store-red">' . $store . '</span>';
                break;
            case 2:
                return '<span class="store-block store-green">' . $store . '</span>';
                break;
            case 3:
                return '<span class="store-block store-blue">' . $store . '</span>';
                break;
            case 4:
                return '<span class="store-block store-purple">' . $store . '</span>';
                break;
        }
    }

}
